home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cc03.arc / NETSTAT.C < prev    next >
Encoding:
C/C++ Source or Header  |  1986-03-15  |  2.0 KB  |  76 lines

  1. /**    NETSTAT.C - Fetches novell network name with novell calls  **/
  2.  
  3. #include "stdio.h"
  4. #include "dos.h"
  5.  
  6. /**    Novell Variable length call buffers  **/
  7. char    tx[300], rx[300];
  8.  
  9. main()
  10. {
  11.     int    wind;            /* window id number */
  12.     char    string[100];        /* string to print in window */
  13.  
  14.     tx[0] = 1;            /* set for 1 byte */
  15.     tx[1] = 0;            /* second byte of buffer length */
  16.     tx[2] = 17;            /* set command into buffer */
  17.  
  18.     rx[0] = 255;            /* set return length */
  19.     rx[1] = 0;
  20.  
  21.     log_request(&tx, &rx);        /* call novell */
  22.  
  23.     color(0,3);
  24.     wind=open_window(5,20,19,60);    /* open up window */
  25.     locate_window(wind,1,1);    /* position cursor */
  26.     print_window(wind,"Novell File Server Status (AHA 8508.27)");
  27.     locate_window(wind,2,0);    /* position cursor */
  28.     print_window(wind,"╟───────────────────────────────────────");
  29.     locate(7,60);         /* position cursor */
  30.     place(182);
  31.  
  32.     locate_window(wind,3,12);     /* position cursor */
  33.     sprintf(string,"Server Name: %s", &rx[2]);
  34.     print_window(wind,string);
  35.  
  36.     locate_window(wind,5,10);     /* position cursor */
  37.     sprintf(string,"Software Version: %d.%d",rx[50],rx[51]);
  38.     print_window(wind,string);
  39.  
  40.     locate_window(wind,7,8);    /* position cursor */
  41.     sprintf(string,"Allowable connections: %d",rx[53]);
  42.     print_window(wind,string);
  43.  
  44.     locate_window(wind,9,10);     /* position cursor */
  45.     sprintf(string,"Connections in use: %d",rx[55]);
  46.     print_window(wind,string);
  47.  
  48.     locate_window(wind,11,6);     /* position cursor */
  49.     sprintf(string,"Maximum Allowable volumes: %d",rx[57]);
  50.     print_window(wind,string);
  51.  
  52.     locate_window(wind,13,12);      /* position cursor */
  53.     print_window(wind,"(Press any key)");
  54.  
  55.     getch();
  56.     close_window(wind);
  57. }
  58. log_request(transmit, recieve)
  59. int    transmit,recieve;
  60. {
  61.     int   *inxptr;
  62.     union REGS  inregs, outregs;
  63.     struct SREGS segreg;
  64.     char  *incptr;
  65.     segread(&segreg);
  66.     inxptr = &segreg.es;
  67.     *inxptr = segreg.ds;
  68.     inxptr = &inregs.x.si;
  69.     *inxptr = transmit;
  70.     inxptr = &inregs.x.di;
  71.     *inxptr = recieve;
  72.     incptr = &inregs.h.ah;
  73.     *incptr = '\xe3';
  74.     intdosx(&inregs, &outregs ,&segreg);
  75. }
  76.